package com.zy.edu.controller;

import com.zy.edu.bean.ResponseInfo;
import com.zy.edu.bean.User;
import com.zy.edu.service.UserService;
import lombok.NonNull;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Map;

/**
 * @author: HuangHaiShui
 * @description:
 * @date: 2021/7/13 10:16
 * @version: 1.0
 */
@RestController

public class LoginController {

    @Resource
    UserService userService;

    /**
     * @Author: HuangHaiShui
     * @Description:  登录接口
     * @Date: 11:08 2021/7/13
     * @param user:
     * @return: Map
     **/
    @RequestMapping("login")
    public Map login(@Valid  User user  ){

       return  userService.oauth(user.getAccount(),user.getPassword());
    }

}
